package at.chl.genetic.function.math.node;

import java.util.List;

import at.chl.genetic.function.math.random.MathRandomUtil;
import at.chl.genetic.function.math.request.MathFunctionRequest;
import at.chl.genetic.function.math.result.MathFunctionResult;
import at.chl.genetic.node.IDecisionNode;

public class ConstantNode extends AbstractMathDecisionNode{
	
	
	
	public ConstantNode(long constant){
		this.constant=constant;
		setHash(createHashCode("CONSTANT"+constant));
	}
	
	

	private long constant;

	

	@Override
	public int getChildrenCount() {
		return 0;
	}



	@Override
	public MathFunctionResult evaluate(MathFunctionRequest request) {
		return new MathFunctionResult(constant);
	}



	@Override
	public void print(String tab) {
		System.out.println(tab+constant);
	}



	@Override
	public List<IDecisionNode> getChildNodes() {
		// no need for action
		return null;
	}



	@Override
	public void setChildNodes(List<IDecisionNode> childNodes) {
		// no need for action
		
	}



	@Override
	public String getName() {
		return "CONSTANT-"+constant;
	}



	@Override
	public IDecisionNode cloneNode() {
		IDecisionNode clone=new ConstantNode(constant);
		return clone;
	}
	
	
	
	
}
